var obj_init_x;
var obj_init_y;
// body.js-ben:
// var mouse_init_x;
// var mouse_init_y;
// var draggedobj = null;

function start_drag( obj, event ) {
	draggedobj = obj.parentNode;
	obj_init_x = parseInt(draggedobj.style.left);	// parseInt() sring-bol int-et csinal
	obj_init_y = parseInt(draggedobj.style.top);
	mouse_init_x = event.clientX;
	mouse_init_y = event.clientY;
}

function stop_drag() {
	draggedobj = null;
}

function switch_drag( obj, event ) {
	if( draggedobj ) {
		stop_drag();
	} else {
		start_drag( obj, event );
	}
}

function drag( event ) {
	draggedobj.style.left = (obj_init_x + (event.clientX - mouse_init_x)) + "px";
	draggedobj.style.top = (obj_init_y + (event.clientY - mouse_init_y)) + "px";
}